<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="none">
<link type="image/x-icon" rel="shortcut icon" href="/static/favicon.ico" />
<script type="text/javascript"
	src="//cdnjscn.b0.upaiyun.com/libs/jquery/2.1.1/jquery.min.js"></script>
</head>
<body>
<!--默认访问/proxylogin.html 放在项目的跟目录下 -->
	<script type="text/javascript">
		var askurl;
		var askData;
		var okurl;
		var returnUrl;
		var ssoLoginUrl;
		

		var url;
		$.ajax({
			type : "GET",
			url : "ahfounderbd/ssoclient/proxylogin",
			dataType : "json",
			success : function(data) {
				askurl = data.askurl;
				askData = data.askData;
				okurl = data.okurl;
				returnUrl = data.returnUrl;
				ssoLoginUrl = data.ssoLoginUrl;
				url = data.url;
				alert("returnUrl:"+returnUrl);
				alert("ssoLoginUrl:"+ssoLoginUrl);

				alert("url:"+url);
				proxyLogin(askurl,askData, okurl,returnUrl,ssoLoginUrl);
			}
		});

		function proxyLogin(askurl, askData, okurl,returnUrl,ssoLoginUrl) {
			var killAjax = true;
			setTimeout(function() {
				checkajaxkill();
			}, 30000);
			var ajaxCall = jQuery
					.getJSON(
							askurl + "?callback=?",
							{
								askData : askData
							},
							function(d) {
								killAjax = false;
								if (d.msg == "-1") {
									window.location.href = ssoLoginUrl+"?ReturnURL="+returnUrl+"/proxylogin.html";
								} else {
									 
									$.post(okurl, {
										replyTxt : d.msg
									}, function(e) {
										window.location.href = e.returl;
									}, "json");
								}
							});
			function checkajaxkill() {
				if (killAjax) {
					ajaxCall.abort();
					window.location.href = url+"/timeout";
				}
			}
		}
		
	</script>
	<div align="center" style="margin-top: 180px;">页面正在加载中，请稍候……</div>
</body>
</html>